package com.timeset.photo.service;

import com.baidu.aip.imageclassify.AipImageClassify;
import com.baidu.aip.ocr.AipOcr;
import com.google.gson.Gson;
import com.timeset.activity.entity.Img;
import com.timeset.photo.entity.Photo;
import com.timeset.photo.entity.PhotoList;
import com.timeset.photo.mapper.PhotoMapper;
import org.json.JSONObject;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.*;


@Service
public class PhotoServiceImpl {
    @Resource
    private PhotoMapper photoMapper;


    //上传图片
    public int addImg(int id,String path){
        return photoMapper.addImg(id,path);
    }
    //根据图片id删除照片
    public int deleteImg(int id){
        return photoMapper.deleteImg(id);
    }



    //更新组织头像
    public int updateOrgImgPath(String headPath, int id){
        return photoMapper.updateOrgImgPath(headPath,id);
    }


    //更新组织认证资料
    public int updateOrgImgAuthPath(String content,int id){

        return photoMapper.updateOrgIdentityContent(content, id);
    }
    //修改学生头像
    public int updateStuHeadPath(int id,String path){
        return photoMapper.updateStuHeadPath(id, path);
    }

    //修改学生学生证件正面
    public int updateStuObverse(int id,String obverse){
        return photoMapper.updateStuObverse(id, obverse);
    }
    //修改学生学生证件反面
    public int updateStuReverse(int id,String reverse){
        return photoMapper.updateStuReverse(id, reverse);
    }
    //根据活动id查找所有照片id
    public List<Img> findImgIdByActivityId(int id){
        return photoMapper.findImgIdByActivityId(id);
    }



}
